home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / dtswps.zip / DTSFILES.ZIP / EXAMPLE / EX1.CPP < prev    next >
Text File  |  1996-06-27  |  1KB  |  56 lines

  1. // Generated from ex1.idl at 04/18/96 12:24:48 EDT
  2. // By IBM DTS C++ implementation template emitter version 1.2
  3. // Using hc.efw file version 1.4
  4. #include <ex1.hh>
  5.  
  6. /*
  7.  * Begin implementation of interface EX1
  8.  */
  9.  
  10. // default ctor for dtsdefaults
  11. EX1::EX1()
  12. {
  13. }
  14.  
  15. /*
  16.  * local fcn returns the module handle for the EX1 dll
  17.  */
  18. static HMODULE hmod = 0;
  19. HMODULE gethmod()
  20. {
  21.    string path;
  22.    if (!hmod) {
  23.       path  = SOMClassMgrObject->somLocateClassFile(somIdFromString("EX1"),0,0);
  24.       if (path && strlen(path))
  25.           DosQueryModuleHandle(path,&hmod);
  26.    }
  27.    return hmod;
  28. }
  29.  
  30.  
  31. //   Add option to the popup menu
  32. ::BOOL EX1::wpModifyPopupMenu(::HWND hwndMenu, ::HWND hwndCnr,
  33.                               ::ULONG iPosition)
  34. {
  35.    wpInsertPopupMenuItems(hwndMenu, iPosition, gethmod(), ID_EX1MENU, 0);
  36.    return (SOM_PARENT_EX1(this,wpModifyPopupMenu,WPObject,SOM_MTOKEN_WPObject(wpModifyPopupMenu))
  37.                          (this, hwndMenu, hwndCnr, iPosition));
  38. }
  39.  
  40.  
  41. //   Process input from the added menu option.
  42. ::BOOL EX1::wpMenuItemSelected(::HWND hwndFrame, ::ULONG ulMenuId)
  43. {
  44.     if (ulMenuId == ID_DOEX1THING) {
  45.         DosBeep(1000,200);
  46.         DosBeep(1000,200);
  47.         DosBeep(1000,200);
  48.         DosBeep(800,400);
  49.         return 1;
  50.     }
  51.     else
  52.        return (SOM_PARENT_EX1(this,wpMenuItemSelected,WPObject,SOM_MTOKEN_WPObject(wpMenuItemSelected))
  53.                              (this, hwndFrame, ulMenuId));
  54. }
  55.  
  56.